package emulator;

import java.util.ArrayList;

public class Result {
	private String word;
	private int priority;
	private ArrayList<Float> runTimeList; 
	private ArrayList<Float> entropyRestList;
	private ArrayList<Float> entropyNeededList;
	private ArrayList<Float> entropyGainedList;
	private ArrayList<String> layoutList;
	
	public Result() {
		layoutList = new ArrayList<>();
		runTimeList = new ArrayList<>();
		entropyRestList = new ArrayList<>();
		entropyNeededList = new ArrayList<>();
		entropyGainedList = new ArrayList<>();
	}
	
	public void SetWord(String _word) {
		word = _word;
	}
	
	public void SetPriority(int _priority) {
		priority = _priority;
	}
	
	public String GetWord() {
		return word;
	}
	
	public int GetPriority() {
		return priority;
	}
	
	public void AddLayout(String layout) {
		layoutList.add(layout);
	}
	
	public void addRunTime(float runTime) {
		runTimeList.add(runTime);
	}
	
	public void addEntropyRest(float entropyRest) {
		entropyRestList.add(entropyRest);
	}
	
	public void addEntropyNeeded(float entropyNeeded) {
		entropyNeededList.add(entropyNeeded);
	}
	
	public void addEntropyGained(float entropyGained) {
		entropyGainedList.add(entropyGained);
	}
	
	public float getRunTime(int i) {
		return runTimeList.get(i);
	}
	
	public float getEntropyRest(int i) {
		return entropyRestList.get(i);
	}
	
	public float getEntropyNeeded(int i) {
		return entropyNeededList.get(i);
	}
	
	public float getEntropyGained(int i) {
		return entropyGainedList.get(i);
	}
	
	public String GetResult() {
		String output = word + " " + priority + "\r\n";
		for (int i = 0; i < layoutList.size(); i++) {
			output += layoutList.get(i) + " " + entropyRestList.get(i) + " " + entropyNeededList.get(i) + " " + entropyGainedList.get(i) + " " + runTimeList.get(i) + "\r\n";
		}
		return output;
	}
	
	public String GetExpression(int i) {
		return layoutList.get(i);
	}
}
